package com.lemonsama.lesson2;

import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class MyActionListener1 implements ActionListener {

    @Override
    public void actionPerformed(ActionEvent e) {
        TextField source = (TextField) e.getSource();
        String text = source.getText();
        System.out.println(text);
        //回车设置为空
        source.setText("");
    }
}
